//运行这个说明是app框架里面的
CFROM	 = 'we';
rockready	 = function(){
	rockbool = true;
	device	 = rock.deviceId;
	CFROM	 = rock.appType+'app';
	if(typeof(initrock)=='function')initrock();
	js.prompt=function(msg,fun,tit,txt,lxs){
		if(!tit)tit='';
		if(!txt)txt='';
		rock.mainFun('prompt', {
			title:tit,
			msg:msg,
			text:txt
		}, function(ret){
			if(ret.buttonIndex==1)fun('yes', ret.text);
		});
	}
	js.confirm=function(msg,fun,tit){
		if(!tit)tit='';
		rock.mainFun('confirm', {
			title:tit,
			msg:msg
		}, function(ret){
			if(ret.buttonIndex==1)fun('yes');
		});
	}
	js.showmenu = function(da){
		var dsa = da.data;
		var str = '',i,len=dsa.length;
		
		for(i=0;i<len;i++){
			str+=','+dsa[i].name+'';
			if(dsa[i].color)str+='|'+dsa[i].color+'';
		}
		rock.mainFun('createMenu', {
			menu:str.substr(1)
		}, function(ret){
			var d = dsa[ret.menuIndex];
			da.onclick(d);
		});
	}
	js.viewimg	= function(can){
		rock.mainFun('imageView', {
			url:can.src,
			filesizecn:can.filesizecn
		});
	}
	
	window.open = function(url){
		if(url.substr(0,4)!='http')url = NOWURL+url;
		rock.mainFun('openWin', {url:url});
	}
}